import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/admin/employeeInfo/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/admin/employeeInfo',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/admin/employeeInfo/' + id,
    method: 'get'
  })
}

export function delObj(id, quit) {
  return request({
    url: '/admin/employeeInfo/' + id + '/' + quit,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/admin/employeeInfo',
    method: 'put',
    data: obj
  })
}

export function fetchDeptTree() {
  return request({
    url: '/admin/dept/getTreeByCurrentUser',
    method: 'get'
  })
}

export function fetchWorkedList(query) {
  return request({
    url: '/admin/employeeWorked/page',
    method: 'get',
    params: query
  })
}
export function fetchFamilyList(query) {
  return request({
    url: '/admin/employeeFamily/page',
    method: 'get',
    params: query
  })
}

export function addFamily(obj) {
  return request({
    url: '/admin/employeeFamily',
    method: 'post',
    data: obj
  })
}

export function putFamily(obj) {
  return request({
    url: '/admin/employeeFamily',
    method: 'put',
    data: obj
  })
}
export function delFamily(id) {
  return request({
    url: '/admin/employeeFamily/' + id,
    method: 'delete'
  })
}
export function addWork(obj) {
  return request({
    url: '/admin/employeeWorked',
    method: 'post',
    data: obj
  })
}

export function putWork(obj) {
  return request({
    url: '/admin/employeeWorked',
    method: 'put',
    data: obj
  })
}
export function delWork(id) {
  return request({
    url: '/admin/employeeWorked/' + id,
    method: 'delete'
  })
}

export function openFigerModel(obj) {
  return request({
    url: '/entrance-guard/guardFinger/openFigerModel',
    method: 'post',
    data: obj
  })
}
